/*    */ package com.zimbra.cs.service.admin;
/*    */ 
/*    */ import com.zimbra.common.account.Key.AccountBy;
/*    */ import com.zimbra.common.account.Key.DistributionListBy;
/*    */ import com.zimbra.common.service.ServiceException;
/*    */ import com.zimbra.common.soap.Element;
/*    */ import com.zimbra.cs.account.Account;
/*    */ import com.zimbra.cs.account.Group;
/*    */ import com.zimbra.cs.account.Provisioning;
/*    */ import java.util.LinkedList;
/*    */ import java.util.List;
/*    */ import java.util.Map;
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ public abstract class ReloadMemberPostProxyHandler
/*    */   extends DistributionListDocumentHandler
/*    */ {
/*    */   public boolean domainAuthSufficient(Map context)
/*    */   {
/* 37 */     return true;
/*    */   }
/*    */   
/*    */   protected Group getGroup(Element request) throws ServiceException
/*    */   {
/* 42 */     String id = request.getAttribute("id");
/* 43 */     return Provisioning.getInstance().getGroup(Key.DistributionListBy.id, id);
/*    */   }
/*    */   
/*    */   protected List<String> getMemberList(Element request, Map<String, Object> context) throws ServiceException {
/* 47 */     List<String> memberList = new LinkedList();
/* 48 */     for (Element elem : request.listElements("dlm")) {
/* 49 */       memberList.add(elem.getTextTrim());
/*    */     }
/* 51 */     return memberList;
/*    */   }
/*    */   
/*    */   public void postProxy(Element request, Element response, Map<String, Object> context)
/*    */     throws ServiceException
/*    */   {
/* 57 */     List<String> memberList = getMemberList(request, context);
/* 58 */     Provisioning prov = Provisioning.getInstance();
/* 59 */     for (String memberName : memberList) {
/* 60 */       Account acct = prov.get(Key.AccountBy.name, memberName);
/* 61 */       if (acct != null) {
/* 62 */         prov.reload(acct);
/*    */       }
/*    */     }
/*    */   }
/*    */ }


/* Location:              /home/mint/zimbrastore.jar!/com/zimbra/cs/service/admin/ReloadMemberPostProxyHandler.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       0.7.1
 */